package top.whk0710.WebDemo.service.impl;

import org.springframework.stereotype.Service;
import top.whk0710.WebDemo.dao.UserDao;
import top.whk0710.WebDemo.entity.User;
import top.whk0710.WebDemo.service.UserService;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用户服务接口实现类
 * Created by whk0710 on 2018/04/19
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Resource
    private UserDao u_dao;

    @Override
    public User checkIsExist(String userName) {
        return u_dao.findUserByName(userName);
    }

    @Override
    public List<User> findAll() {
       return u_dao.getAllUser();
    }

    @Override
    public int addUser(User u) {
        return u_dao.addUser(u);
    }

    @Override
    public int deleteUser(String id) {
        return u_dao.deleteUser(id);
    }

}
